package mobilizator.app.list;

import java.util.ArrayList;

import mobilizator.app.MobilizatorApp;
import mobilizator.app.R;
import mobilizator.app.data.Cloth;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
import android.widget.TextView;

public class ClothListActivity extends Activity {
	
	private TextView title;
	private ArrayList<Cloth> clothes;
	private ListView listView;
	Bundle extras;
	
	@Override
    protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.cloth_list);
		
		title = (TextView) findViewById(R.id.header_title);
		title.setText("Lista ubrań");
		
		extras = getIntent().getExtras();
		clothes = MobilizatorApp.mdb.getClothesForCategory(extras.getLong("category"));
		Log.d("ilosc_ciuchow", new Integer(clothes.size()).toString());
		
		listView = (ListView) findViewById(R.id.cloth_list_listView);
		listView.setAdapter(new ClothsAdapter(this, clothes));
	}
	
}